<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>小米商城</title>
	<meta name="description" content="小米官网直营小米公司旗下所有产品，包括小米手机系列小米10 Pro 、小米9、小米MIX Alpha，Redmi 红米系列Redmi 10X、Redmi K30，小米电视、笔记本、米家智能家居等，同时提供小米客户服务及售后支持." />
    <meta name="keywords" content="小米,redmi,小米10,Redmi 10X,小米MIX Alpha,小米商城" />
	<!--处理样式-->
	<link rel="stylesheet" type="text/css" href="static/css/reset.css">
	<!--公共的CSS-->
	<link rel="stylesheet" type="text/css" href="static/css/style.css">
	<!--首页的CSS-->
	<link rel="stylesheet" type="text/css" href="static/css/index.css">
	<!--引入网页标题图标-->
	<link rel="shortcut icon" type="static/image/x-icon" href="static/img/favicon.ico">
</head>
<style>
 <style>

    .container {
      max-width: 800px;
      margin: 0 auto;
      padding: 20px;
    }
    h1 {
      text-align: center;
    }
    table {
      width: 100%;
      border-collapse: collapse;
      margin-top: 20px;
    }
    th, td {
      border: 1px solid #dddddd;
      padding: 8px;
      text-align: left;
    }
    th {
      background-color: #f2f2f2;
    }
    .btn {
      text-decoration: none;
      padding: 6px 12px;
      display: inline-block;
      margin-bottom: 0;
      font-size: 14px;
      font-weight: 400;
      line-height: 1.42857143;
      text-align: center;
      white-space: nowrap;
      vertical-align: middle;
      cursor: pointer;
      border: 1px solid transparent;
      border-radius: 4px;
      transition: all 0.3s ease;
    }
    .btn-success {
      color: #fff;
      background-color: #5cb85c;
      border-color: #4cae4c;
    }
    .btn-success:hover {
      background-color: #449d44;
      border-color: #398439;
    }
    .btn-info {
      color: #fff;
      background-color: #5bc0de;
      border-color: #46b8da;
    }
    .btn-info:hover {
      background-color: #31b0d5;
      border-color: #269abc;
    }
    .btn-danger {
      color: #fff;
      background-color: #d9534f;
      border-color: #d43f3a;
    }
    .btn-danger:hover {
      background-color: #c9302c;
      border-color: #ac2925;
    }
    .btn-group {
      margin-right: 10px;
    }
  </style>
</style>
<body>
<div class="page-top">
	<div class="container">
	<div class="top-lt">
		<a href="{{ url_for('index') }}">小米商城</a>
			<span>|</span>
		<a href="">MIUI</a>
			<span>|</span>
		<a href="">IoT</a>
			<span>|</span>
		<a href="">云服务</a>
			<span>|</span>
		<a href="">金融</a>
			<span>|</span>
		<a href="">有品</a>
			<span>|</span>
		<a href="">小爱开放平台</a>
			<span>|</span>
		<a href="">企业团购</a>
			<span>|</span>
		<a href="">资质证照</a>
			<span>|</span>
		<a href="">协议规则</a>
			<span>|</span>
		<a href="" class="download">下载app
			<div class="down-box">
				<img src="static/img/download.png" alt="小米商城">
				小米商城APP
			</div>
		</a>
	</div>

	<div class="top-gt">
		<div class="car-box">
			<a href="" class="tit">购物车</a>
			<div class="pop">
			<!--	<p class="no-good">购物车还没有商品，赶紧选购吧！</p>  -->
			<ul class="list">
				{%for product in comment_products1 %}
				<li>
					<a href="" class="pic"><img src="static/img/xiaomi14_1.png"></a>
					<div class="txt">小米14，{{product.config}}</div>
					<div class="num">
						<i>X</i>
						<h4>{{product.price}}</h4>

					</div>
				</li>
				{%endfor%}

			</ul>
			<div class="total">
				<div class="price">
					<p>共{{num}}件商品</p>
					<h3>{{price}}</h3>
				</div>
				<a href="" class="btn">立即结算</a>
			</div>

			</div>
		</div>
		<div class="login">
			{% if session['logged_in'] %}
                                <span class="username">欢迎{{session['username']}}登录</span>
									<a href="/product_board">商品管理</a>
                                <a href="/logout">退出</a>
                            {% else %}
                                <a href="/login">登录</a>
                            {% endif %}
			<span>|</span>
			<a href="register">注册</a>
			<span>|</span>





		</div>
		<!--<div class="userinfo">
			<a href="" class="link">消息通知</a>
			<a href="" class="link">我的订单</a>
			<div class="user">
				<a href="" class="tit">用户~~</a>
				<ul>
				<li><a href="">个人中心</a></li>
				<li><a href="">评价晒单</a></li>
				<li><a href="">我的喜欢</a></li>
				<li><a href="">小米账号</a></li>
				<li><a href="">退出登录</a></li>
				</ul>
			</div>
-->		</div>
	</div>
	</div>
</div>
<!--导航-->
<div class="page-nav">
	<div class="container">
		<a href="{{ url_for('index') }}" class="logo"></a>
		<ul class="nav">

			<li class="nav-item">
				<a href="" class="tit">小米手机</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">Redmi 红米</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">电视</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">笔记本</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">家电</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">路由器</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">智能硬件</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">服务</a>
			</li>
			<li class="nav-item">
				<a href="" class="tit">社区</a>
			</li>
		</ul>
		<!--搜索框-->
		<div class="search">
			<form action="" method="post">
				<input type="text" name="" class="q">
				<input type="submit" class="btn" name="" value="">
				<div class="tags">
					<span  >小米14</span>
				</div>

				<ul class="hot">
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>
					<li>
						<a href="">
						<span>红米K30 pro</span>
						</a>
					</li>

				</ul>
			</form>
		</div>
	</div>
</div>

<div class="container content">
  <h1>商品管理后台
    <a class="btn btn-success" href="/add_product" style="float:right"> 发布商品 </a>
  </h1>
  <hr>
  <table class="table">
    <tr>
      <th>ID</th>
      <th>商品名称</th>
      <th>商品价格</th>
      <th>商品图片</th>
      <th></th>
      <th></th>
    </tr>
    {% for one_product in products %}
      <tr>
        <td> {{ one_product.id}}</td>
        <td> {{ one_product.pname}}</td>
		<td> {{ one_product.new_price}}</td>
		<td> <img src="{{ one_product.images}}" style="max-width: 50px; max-height: 100px;"></td>
        <td><a href="#" class="btn btn-info" style="float:right">编辑</a></td>
        <td>
          <form action="{{url_for('delete_product', id=one_product.id)}}" method="post">
            <input type="hidden" name="_method" value="DELETE">
            <input type="submit" value="删除" class="btn btn-danger">
          </form>
        </td>
      </tr>
      {% endfor %}
  </table>
</div>

</body>
</html>